<%@ page import="com.sun.org.apache.xalan.internal.xslt.Process" %>
<%@ page import="com.hyy.bean.MaskUser" %>
<%@ page import="com.hyy.bean.Merchandise" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/11/13 0013
  Time: 15:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品详情</title>
	<!-- 新 Bootstrap 核心 CSS 文件 -->
	<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
	<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

	<link rel="stylesheet" href="../css/details.css" />
	<!--引入Bootstrap资源-->
	<script type="text/javascript" src="js/detail.js" ></script>


</head>
<body >
<!--top bar制作-->

<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
		</div>
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav">
				<li class="active"><a class="navbar-brand" href="/" style="color: black;font-weight:bold">毒潮商城</a></li>
				<li style="color: purple"><a>有毒的运动×潮流×好物</a></li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<%if (request.getSession().getAttribute("user")==null){%>
				<li><a href="jsp/login.jsp">登入</a></li>
				<li><a href="jsp/register.jsp" >注册</a></li>
				<% }else { %>
				<li><a href="/toUsermsg">
					<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
					<%=((MaskUser)request.getSession().getAttribute("user")).getUseraccount() %>
				</a></li>
				<li>
					<a href="/myCart">
						<span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"  ></span>
						购物车
				<span class="sr-only">(current)</span>
				</a>
				</li>
				<li><a onclick="if(confirm('确认注销？')==false)return false;location.href='/logout'">注销
				</a></li>
				<% } %>
			</ul>
		</div>
	</div>
</nav>
<!--详情的主体-->
<% Merchandise merchandise = (Merchandise)request.getAttribute("merchandise");%>
<div class="row">
    <div class="col-md-4 col-md-offset-2" >
        <img src="img/<%=merchandise.getImg()%>" style="width: 75% "/>
    </div>
    <div class="col-md-4" style="border-top: 100px">
        <br />
        <h2><%=merchandise.getProductName() %></h2>
        价格:￥<%=merchandise.getPrice() %><br />
       	销量：<%=merchandise.getSales() %> 件<br/>
		库存：剩余 <nobr style="color: #c9302c;font-size: 20px"><%=merchandise.getStock()%></nobr>
		件<br />
		服务说明     全场免运费  |  由毒潮官方仓库负责发货，并提供售后服务<br />
        <div id="addcar">
			<form method="post" action="/insertCart">
				<input type="hidden" name = "mid" value="<%=merchandise.getId()%>"/>
				<div id="addsubnum">
					<div>
						<input type="text" id="num" value="1" name="num" style="text-align:center"/>
					</div>
					<div id="addsubfh">
						<div>
							<input type="button" id="increase" value="+" onclick="addOne()" />
						</div>
						<div>
							<input type="button" id="decrease" value="-" onclick="subOne()" />
						</div>
					</div>
				</div>
				<div  id="addcarbutton" >
					<br />
					<a>
						<input type="submit" value="加入购物车" id="addcarbtn"/>
					</a>
					<a href="/toOrder?mid=<%=merchandise.getStock()%>">
						<input type="button" value="立即下单 " id="ljxd" style="margin-left: 15px"/>
					</a>
				</div>
			</form>
        </div>

    </div>
</div>

<!--底部设置-->
<hr />
<div class="row">
	<div class="col-md-8 col-md-offset-2">
		<div class="row">
			<div class="col-md-2 col-md-offset-1" style="text-align: center;">
				<div class="thumbnail" style="border: 0px;">
					<img src="../img/末尾/true.png" alt="..." class="img-responsive" width="50%" >
					<div class="caption">
						<h4>正品货源</h4>
					</div>
				</div>
			</div>
			<div class="col-md-2" style="text-align: center;">
				<div class="thumbnail" style="border: 0px;">
					<img src="../img/末尾/检查.png" alt="..." class="img-responsive" width="50%" >
					<div class="caption">
						<h4>入仓检验</h4>
					</div>
				</div>
			</div>
			<div class="col-md-2" style="text-align: center;">
				<div class="thumbnail" style="border: 0px;">
					<img src="../img/末尾/货车.png" alt="..." class="img-responsive" width="50%" >
					<div class="caption">
						<h4>无忧退换</h4>
					</div>
				</div>
			</div>
			<div class="col-md-2" style="text-align: center;">
				<div class="thumbnail" style="border: 0px;">
					<img src="../img/末尾/仓库.png" alt="..." class="img-responsive" width="50%" >
					<div class="caption">
						<h4>自营仓储</h4>
					</div>
				</div>
			</div>
			<div class="col-md-2" style="text-align: center;">
				<div class="thumbnail" style="border: 0px;">
					<img src="../img/末尾/赔.png" alt="..." class="img-responsive" width="50%" >
					<div class="caption">
						<h4>正品保险</h4>
					</div>
				</div>
			</div>
		</div>
		<p style="background-color: black;color: aliceblue;font-size: 15px;"  align="center">
			<a href="#" style="color: aliceblue;">关于我们</a> |
			<a href="#" style="color: aliceblue;">About us</a> |
			<a href="#" style="color: aliceblue;">品牌招商</a> |
			<a href="#" style="color: aliceblue;">联系我们</a> |
			<a href="#" style="color: aliceblue;">隐私条例</a>
		</p>
	</div>
</div>
</body>
</html>

